(define-module (Z572 packages emacs-xyz)
  #:use-module (gnu packages code)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix packages)
  #:use-module (guix build-system emacs)
  #:use-module (gnu packages search)
  #:use-module (guix git-download)
  #:use-module (guix download)
  #:use-module (guix utils)
  #:use-module ((guix licenses) #:prefix license:))

(define-public emacs-citre
  (let ((commit "9a0dcc5dad0b0796c8febba1470db49b3e845f2b")
        (revision "0"))
    (package
      (name "emacs-citre")
      (version (git-version "0.1.1" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/universal-ctags/citre")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "13zl0bxnxqm6cq71lj02d906mpmmd1xpwji3d23fvy80nkxzrm86"))))
      (build-system emacs-build-system)
      (arguments
       `(#:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'patch-ctag-path
             (lambda* (#:key inputs #:allow-other-keys)
               (make-file-writable "citre-core.el")
               (emacs-substitute-variables "citre-core.el"
                 ("citre-readtags-program"
                  (string-append (assoc-ref inputs "universal-ctags")
                                 "/bin/readtags"))))))))
      (inputs `(("universal-ctags" ,universal-ctags)))
      (home-page "https://github.com/universal-ctags/citre")
      (synopsis "Ctags IDE on the True Editor")
      (description
       "Citre is an advanced Ctags (or actually, readtags) frontend for Emacs.")
      (license license:gpl3+))))

(define-public emacs-bing-dict
  (let ((commit "1d581aaa9622b34f8fb83af5579fa252aa24cfef")
        (revision "0"))
    (package
      (name "emacs-bing-dict")
      (version (git-version "0.2.4" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/cute-jumper/bing-dict.el")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "1v0ncgnj9vv2r0qbwiipg63rlhnfjz8q23jx3la2l22l0i2lyivb"))))
      (build-system emacs-build-system)
      (home-page
       "https://github.com/cute-jumper/bing-dict.el")
      (synopsis
       "Minimalists' English-Chinese Bing dictionary")
      (description
       "A **minimalists'** Emacs extension to search http://www.bing.com/dict.
Support English to Chinese and Chinese to English.")
      ;; from bing-dict.el head
      (license license:gpl3+))))

(define-public emacs-leaf-keywords
  ;;latest git tag is on May 29, 2019, 1.1.0, but leaf-keywords.el version is
  ;;2.0.5
  (let ((commit "4146621f4ae80ef0c30160337119441c1f6334b6")
        (revision "0"))
    (package
      (name "emacs-leaf-keywords")
      (version (git-version "2.0.5" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/conao3/leaf-keywords.el")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "16iv1cvlky2gij1ndx2d6q8l35axm72bx52n6v5y3h21aibj197n"))))
      (build-system emacs-build-system)
      (propagated-inputs `(("emacs-leaf" ,emacs-leaf)))
      (home-page
       "https://github.com/conao3/leaf-keywords.el")
      (synopsis
       "Additional leaf.el keywords for external packages")
      (description
       "This package provides additional keywords for leaf.el defines
keywords that are dependent on an external package.")
      (license license:gpl3+))))

(define-public emacs-easy-escape
  (let ((commit "a6449f22cb97160ee1c90121968de89e193268df")
        (revision "0"))
    (package
      (name "emacs-easy-escape")
      (version (git-version "0.1" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/cpitclaudel/easy-escape")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "1spbavcs4a3vn1ggdcgwgb2wvq4lbk74xyfagr4y5b5w2azlkh51"))))
      (build-system emacs-build-system)
      (home-page
       "https://github.com/cpitclaudel/easy-escape")
      (synopsis
       "Improve readability of escape characters in regular expressions")
      (description
       "This package provides a uses syntax highlighting and composition to make
ELisp regular expressions more readable.")
      (license license:gpl3+))))

(define-public emacs-winum
  (let ((commit "c5455e866e8a5f7eab6a7263e2057aff5f1118b9")
        (revision "0"))
    (package
      (name "emacs-winum")
      (version (git-version "2.2.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/deb0ch/winum.el")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "0lj4cp7ml7cjhkd66f6ivcl6sbfs2my8ajjlynzl3pm5qansfw5i"))))
      (build-system emacs-build-system)
      (propagated-inputs `(("emacs-dash" ,emacs-dash)))
      (home-page "https://github.com/deb0ch/winum.el")
      (synopsis
       "Navigate windows and frames using numbers.")
      (description
       "Window numbers for Emacs: Navigate your windows and frames using
numbers.")
      (license license:gpl3+))))

(define-public emacs-puni
  (let ((commit "3a3272c881945f0dfb4467f7f053d0853f612186")
        (revision "0"))
    (package
      (name "emacs-puni")
      (version (git-version "0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/AmaiKinono/puni")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1m2z4sif8558qyjzp33kfbjr1laz3nh79qbpzbnykk0j73q5zb9z"))))
      (build-system emacs-build-system)
      (home-page "https://github.com/AmaiKinono/puni")
      (synopsis "Parentheses Universalistic")
      (description "Customizable soft deletion commands")
      (license license:gpl3+))))

(define-public emacs-meow
  (let ((commit "56f0365dca1dbb3e97a32cf3da65f817598731b2")
        (revision "0"))
    (package
      (name "emacs-meow")
      (version (git-version "1.0.2" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://www.github.com/DogLooksGood/meow")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "10qp7s84p0j9byrwsfwbr1vyvad8v5y28v8dv7x7mm05pkcr9vv1"))))
      (build-system emacs-build-system)
      (propagated-inputs
       `(("emacs-dash" ,emacs-dash)
         ("emacs-s" ,emacs-s)))
      (home-page
       "https://www.github.com/DogLooksGood/meow")
      (synopsis "Modal Editing On Wheel")
      (description
       "Enable `meow-global-mode' to activate modal editing.")
      (license license:gpl3))))

(define-public emacs-highlight-quoted
  (let ((commit "24103478158cd19fbcfb4339a3f1fa1f054f1469")
        (revision "0"))
    (package
      (name "emacs-highlight-quoted")
      (version (git-version "0.1" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/Fanael/highlight-quoted")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32
           "1gq8inxfni9zgz2brqm4nlswgr8b0spq15wr532xfrgr456g10ks"))))
      (build-system emacs-build-system)
      (home-page
       "https://github.com/Fanael/highlight-quoted")
      (synopsis
       "Highlight Lisp quotes and quoted symbols")
      (description
       "Minor mode proving highlight of Lisp quotes and quoted symbols.")
      (license license:bsd-2))))

(define-public emacs-cmake-mode
  (package
    (name "emacs-cmake-mode")
    (version "20210104.1831")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://melpa.org/packages/cmake-mode-"
             version
             ".el"))
       (sha256
        (base32
         "1qwfrz1n64g0mwzbh1ldqvav0qv19k4rd15mn6448vkkmrayygi2"))))
    (build-system emacs-build-system)
    (home-page "unspecified")
    (synopsis "major-mode for editing CMake sources")
    (description
     "Provides syntax highlighting and indentation for CMakeLists.txt and
*.cmake source files.")
    (license #f)))

(define-public emacs-xeft
  (let ((commit "b9759e2f576b4155cb26de93d1e309152cdd50d1")
        (revision "1"))
    (package
      (name "emacs-xeft")
      (version (git-version "0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/casouri/xeft")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1s3j016xb3vz627k7mnnkp9k6r4cn1v4bbnnh621fhy1ngfgw5ly"))
                (modules '((guix build utils)))
                (snippet
                 '(delete-file "emacs-module.h"))))
      (build-system emacs-build-system)
      (arguments
       `(#:include
         (cons "\\.so$" %default-include)
         #:phases
         (modify-phases %standard-phases
           (add-before 'install 'build-emacs-module
             (lambda* (#:key outputs #:allow-other-keys)
               (invoke "make"
                       (string-append "CXX=" ,(cxx-for-target))
                       (string-append "PREFIX=" (assoc-ref outputs "out"))))))))
      (inputs
       `(("xapian" ,xapian)))
      (home-page "https://github.com/casouri/xeft")
      (synopsis "")
      (description "")
      (license #f))))
